﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Manage_WishNote_Setting : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.bd();
        }
    }
    private void bd()
    {
        WishingWallSetting wws = new WishingWallSetting();
        pagesize_tb.Text = wws.PageSize.ToString();
        timespace_tb.Text = wws.VTime.ToString();
        if (wws.Ireplay == 1)
        {
            shenhe.Checked = true;
        }
        else
        {
            shenhe.Checked = false;
        }
        limitIP_tb.Text = wws.ForbidIP;

    }
    protected void Submit_Click(object sender, EventArgs e)
    {
        WishingWallSetting wws = new WishingWallSetting();
        wws.PageSize = Convert.ToInt32(pagesize_tb.Text);
        wws.VTime = Convert.ToInt32(timespace_tb.Text);
        if (shenhe.Checked)
        {
            wws.Ireplay = 1;
        }
        else
        {
            wws.Ireplay = 0;
        }
        wws.ForbidIP = limitIP_tb.Text;
        try
        {
            wws.Update();
            ClientScript.RegisterStartupScript(GetType(), "message", "<script>alert('更新设置成功');</script>");
        }
        catch
        {

        }
    }
}